package rainQuality;

import rainQuality.dao.RainManageDao;
import rainQuality.dao.impl.RainManageDaoImpl;
import rainQuality.entity.RainManage;

import java.util.List;
import java.util.Scanner;

public class main {
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        RainManageDao rainManageDao=new RainManageDaoImpl();
        boolean sf=true;
        do {
            System.out.println("请输入：");
            int xz=in.nextInt();
            switch (xz){
                case 1:
                    List<RainManage> list=rainManageDao.select();
                    for(RainManage rainManage:list){
                        System.out.print(rainManage.getId()+" ");
                        System.out.print(rainManage.getName()+" ");
                        System.out.print(rainManage.getDate()+" ");
                        System.out.print(rainManage.getRain()+" ");
                        System.out.print(rainManage.getStati()+" ");
                        System.out.print(rainManage.getAdd()+" ");
                        System.out.println();
                    }
                    break;
                case 2:
                    System.out.println("请输入要删除的id：");
                    String id=in.next();
                    rainManageDao.sc(id);
                    break;
                case 3:
                    System.out.println("请输入名称");
                    String name=in.next();
                    System.out.println("监测时间");
                    String date=in.next();
                    System.out.println("雨量值");
                    String yu=in.next();
                    System.out.println("监测站");
                    String stat=in.next();
                    System.out.println("站点地址");
                    String add=in.next();
                    RainManage rainManage=new RainManage(name,date,yu,stat,add);
                    rainManageDao.Xz(rainManage);
                    break;
                case 4:

                    break;
                case 5:

                    break;
            }
        }while (sf);

    }
}
